OBJS = MapSector.o
TESTOBJ = TestMap.o
CC = gcc
INCLUDES = -I.
DEBUG = -g
CFLAGS = -Wall -c $(DEBUG)
LFLAGS = -Wall $(DEBUG)
BIN = mapsector
LIB = libsectormapper.a

lib: $(OBJS)
	ar -cvq $(LIB) $(OBJS)

mapsector : $(OBJS)
	$(CC) $(LFLAGS) $(OBJS) $(INCLUDES) -o $(BIN)

Mapsector.o : MapSector.c
	$(CC) $(CFLAGS) $(INCLUDES) MapSector.c

TestMap.o : TestMap.c
	$(CC) $(CFLAGS) $(INCLUDES) TestMap.c
	
test: lib $(TESTOBJ)
	$(CC) -o $(BIN) $(TESTOBJ) $(LIB)

clean: 
	rm -rf *.o *.a $(BIN)

